<?php
/**
 * 找回密码
 * 
 */

class Forgetpassword extends Base_Controller
{
	
	
	
	public function __construct()
	{
		parent::__construct();		
		$this->load->library('form_validation');
		$this->load->model('member_mdl');
		
	}
	
	/**
	 * 
	 * 默认处理 ...
	 * 
	 */
	public function index()
	{
		$this->form_validation->set_rules('txnikename', '用户名', 'required');
		if ($this->form_validation->run() == FALSE)
		{
			$this->load->view('forgetpassword');
		}else{	
			$data = $this->member_mdl->get_user_bu_txnikename($this->input->post('txnikename'));
			if(!empty($data))
			{
				$data = $this->member_mdl->set_reset_password($data);
				print_r($data);
				//sender email
			}else{
				$data['error'] = '该用户不存在';		
			}
		}
	}
	
	/**
	 * 取回密码
	 * @access public
	 * @param string txnikename
	 * @param string token
	 * @return void
	 */
	
	public function resetpassword($txemail,$token)
	{
		
	}
}